/*
 *    Copyright 2022 The DSMS Authors.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package com.dsms.modules.alert.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;


@TableName("alert_contact")
@ApiModel(value = "AlertContact对象", description = "告警联系人")
@Data
public class AlertContact implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("告警联系人id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("告警联系人类型(0-email,1-sms)")
    @Range(min = 0, max = 1, message = "告警联系人类型不存在")
    private Integer contactType;

    @ApiModelProperty("告警联系人名称")
    @NotBlank(message = "告警联系人名称不能为空")
    @Length(max = 32,message = "告警联系人名称长度不能超过32")
    private String contactName;

    @ApiModelProperty("告警联系人帐号")
    @NotBlank(message = "告警联系人帐号不能为空")
    @Length(max = 32,message = "告警联系人帐号长度不能超过32")
    private String contactAccount;

}
